﻿using System;
using System.Collections.Generic;
using System.Text;
using Hkwl.WorldExpo.Merchant.Service.Impl;
using Hkwl.WorldExpo.Merchant.DataAccess.Impl.IBatisNet;

namespace Hkwl.WorldExpo.Merchant.Service
{
    public class ServiceLocator
    {
        /// <summary>
        /// 构建IMerchantService
        /// </summary>       
        private static IMerchantService _imerchantservice = null;

        public static IMerchantService IMerchantService
        {
            get
            {
                if (_imerchantservice == null)
                {
                    _imerchantservice = new MerchantServiceImpl(new MerchantSqlMapDao());
                }
                return _imerchantservice;
            }
        }


        /// <summary>
        /// 构建IAdminService
        /// </summary>       
        private static IAdminService _iadminservice = null;

        public static IAdminService IAdminService
        {
            get
            {
                if (_iadminservice == null)
                {
                    _iadminservice = new AdminServiceImpl(new AdminSqlMapDao());
                }
                return _iadminservice;
            }
        }

        /// <summary>
        /// 构建IClientService
        /// </summary>       
        private static IClientService _iclientservice = null;

        public static IClientService IClientService
        {
            get
            {
                if (_iclientservice == null)
                {
                    _iclientservice = new ClientServiceImpl(new ClientSqlMapDao());
                }
                return _iclientservice;
            }
        }

        /// <summary>
        /// 构建IProjectService
        /// </summary>       
        private static IProjectService _iprojectservice = null;

        public static IProjectService IProjectService
        {
            get
            {
                if (_iprojectservice == null)
                {
                    _iprojectservice = new ProjectServiceImpl(new ProjectSqlMapDao());
                }
                return _iprojectservice;
            }
        }

        /// <summary>
        /// 构建ILogService
        /// </summary>       
        private static ILogService _ilogservice = null;

        public static ILogService ILogService
        {
            get
            {
                if (_ilogservice == null)
                {
                    _ilogservice = new LogServiceImpl(new LogSqlMapDao());
                }
                return _ilogservice;
            }
        }

    }
}
